<% div_for @issue do %>
  <h2>
    <% if @issue.submitter == @current_user -%>
    <span class="edit_link">
      <%= link_to 'edit', edit_issue_url( @project.name, @issue.local_id ) -%>
    </span>
    <% end -%>
    Issue #<%=h @issue.local_id %>: <%=h @issue.summary %>&nbsp;
    <span class="issue_details">
      <%= time_ago_in_words( @issue.created_at ) %> ago by
      <%= link_to @issue.submitter.display, url_for( @issue.submitter ) %> at
      <%= @issue.created_at.strftime( DATE_TIME_FORMAT ) %>
    </span>
  </h2>

  <div class="floater">
    <h2>Votes</h2>
    <%= render :partial => 'vote', :locals => { :user => @current_user, :project => @project, :issue => @issue } %>
  </div>

  <div class="floater">
    <h2>Actions</h2>
    <ul>
      <li><%= link_to 'Add an Update', :anchor => 'comment_form' %></li>
      <% if @current_user -%>
      <li><%= render :partial => 'subscription', :locals => { :user => @current_user, :project => @project, :issue => @issue }%></span></li>
      <li><%= render :partial => 'adopt', :locals => { :user => @current_user, :project => @project, :issue => @issue } %></li>
      <li><%= render :partial => 'assign', :locals => { :user => @current_user, :project => @project, :issue => @issue } %></li>
      <% end -%>
      <li><%= link_to 'Return to Project', project_url( @project.name ) %></li>
    </ul>
  </div>

  <%= wiki @issue.details %>

  <div class="attachments_and_changes" id="issue_attachments">
    <%= render :partial => 'details', :locals => { :issue => @issue } %>
    <%= render :partial => 'shared/attachments', :locals => { :attachments => @issue.attachments } %>
  </div>

  <br clear="all">
<% end %>

<div class="comment_section">
  <% @issue.comments.each do |c| %>
    <%= render :partial => 'shared/comment', :locals => { :comment => c } %>
  <% end %>
  <div id="new_comment"></div>
</div>

<a name="comment_form"></a>
<%= render :partial => 'shared/comment_form',
            :locals => {
                :project => @project,
                :issue => @issue,
                :comment => Comment.new
              } %>
